import Layout from '@code4x/layout';
import type { RouteRecordRaw } from 'vue-router';

export const homeRoute: RouteRecordRaw = {
  path: '/dashboard',
  name: 'dashboard',
  component: () => import('@/views/dashboard/dashboard.vue'),
  meta: {
    type: 2,
    title: '仪表盘',
    id: Symbol(),
    hidden: false,
    icon: 'dashboard',
    keepAlive: false,
  },
  children: [],
};

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: '/',
    redirect: '/dashboard',
    component: () => Layout,
    meta: {
      title: '主页',
      id: Symbol(),
      hidden: false,
      icon: 'dashboard',
      keepalive: false,
      type: 1,
    },
    children: [homeRoute],
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/login.vue'),
    meta: {
      title: '登录',
      hidden: true,
      icon: 'dashboard',
    },
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/exception/404.vue'),
    meta: {
      title: '404',
      hidden: true,
      icon: 'dashboard',
    },
  },
  {
    path: '/500',
    name: '500',
    component: () => import('@/views/exception/500.vue'),
    meta: {
      title: '500',
      hidden: true,
      icon: 'dashboard',
    },
  },
  {
    path: '/403',
    name: '403',
    component: () => import('@/views/exception/403.vue'),
    meta: {
      title: '403',
      hidden: true,
      icon: 'dashboard',
    },
  },
];

export default routes;
